package 字符串;

import java.util.HashMap;
import java.util.Scanner;

public class 统计单词数 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String str = scanner.nextLine().replace(".","");
        String[] split = str.split("\\s");
        HashMap<String, Integer> map = new HashMap<>();
        // 为每一个单词创建一个map
        for (int i = 0; i < split.length; i++) {
            map.put(split[i],0);
        }
        // 输入
        for (int i = 0; i < split.length; i++) {
            map.put(split[i],map.get(split[i])+1);
        }
        // 输出
        for (int i = 0; i < split.length; i++) {
            if (String.valueOf(map.get(split[i])).equals("null")){
                continue;
            }
            else {
                String sum = "";
                for (int j = 0; j < map.get(split[i]); j++) {
                    sum = sum +"*";
                }
                System.out.println(split[i].toUpperCase()+":"+sum+map.get(split[i]));
                map.remove(split[i]);

            }
        }
    }
}
